/*
 * @Author: 朝来试看青枝上 1140928814@qq.com
 * @Date: 2022-09-25 17:21:21
 * @LastEditors: 朝来试看青枝上 1140928814@qq.com
 * @LastEditTime: 2022-09-27 18:06:08
 * @Description: 默认自定义指令
 */

// 图片出错自定义指令

export default (vue) => {
  vue.directive('fixImg', {
    inserted: (el, binding) => {
      el.onerror = () => {
        el.src = binding.value
      }
      el.src = el.src || binding.value
    }
  })
}
